package com.example.mycamerademo.cameraxlearing

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Rect
import android.util.AttributeSet
import android.view.View

/**
 * @author tgw
 * @date 2021/9/13
 * @describe
 */
class FaceView constructor(
    context: Context?,
    attrs: AttributeSet?,

    ) :
    View(context, attrs) {

    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int
    ) : this(context, attrs) {

    }

        var mFaceRect: Rect? = null

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        mFaceRect?.let {
            canvas?.drawRect(it, Paint().apply {
                color = Color.parseColor("#ffffff")
                strokeWidth = 6f
            })
        }
    }


}